let letters = 'abcdefghijklmnopqrstuvwxyz';
let fearNotLetter = function (w) {
    let pos = -1;
    for (let i = 0; i < w.length - 1; i++) {
        if (letters.indexOf(w[i + 1]) - letters.indexOf(w[i]) != 1) {
            pos = i;
            break;
        }
    }
    if (pos >= 0)
        return letters[pos + 1];
    else
        return undefined;
};

console.log(fearNotLetter("abcd"));
